package pl.qsoft.db.storedProc.statement;

import java.sql.CallableStatement;
import java.sql.SQLException;
import java.util.Map;

import pl.qsoft.db.annotation.StoredProcedureDefinition;
import pl.qsoft.db.annotation.StoredProcedureParam;

/**
 * Responsible for building and handling callable statements before they are executed. The implementor of this interface must properly handle input and output parameters and their values
 * @author Wojciech Kudla
 */
public interface StatementBuilder {
	
	/**
	 * Method called by procedure invocation engine in the process of preparing statement for execution 
	 * @param stmt Callable statement for manipulation
	 * @param proc Stored procedure definition
	 * @param params Stored procedure parameter definitions
	 * @param values Stored procedure parameter values
	 * @return Callable statement prepared for execution
	 * @throws SQLException
	 */
	public CallableStatement buildStatement(CallableStatement stmt, StoredProcedureDefinition proc, StoredProcedureParam[] params, Map<Object, Object> values) throws SQLException;

}
